package org.hyf.inspur.LessonDesin.clear.wordcount;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class WordCountsortMapper extends Mapper <LongWritable, Text, Text, Text> {
    private final Text text=new Text();
    private final IntWritable num=new IntWritable(1);
    @Override
    protected void map(LongWritable key, Text values, Context context) throws IOException, InterruptedException {
       String[] tmp = values.toString().split(" ");
       String setnum = tmp[0];
       String num = tmp[1];
       System.out.println("hahah:"+num);
       context.write(new Text(num), new Text(setnum));
    }
}
